/*

    @三种奖励
    
*/

var props=[];
function createProp(){
    var num=rand(0,800);
    var p=null;
    if(num==10){
        //炸弹
        p=new Prop(0);
        props.push(p);
    } else if(num==8){
        //双排
        p=new Prop(1);
        props.push(p);
    } else if(num==200){
        //密集
        p=new Prop(2);
        props.push(p);
    }
}

/*
    @type 0|炸弹 1|双排 2|密集
*/

function Prop(type) {
    this.x=rand(0,canvas.width-39);
    this.y=-68;
    this.w=39;
    this.h=68;
    this.type=type;
    this.speed=rand(3,10);
    this.isDelete=false;
}

Prop.prototype._move =function (){
    this.y+=this.speed;
    if(this.y>canvas.height){
        this.isDelete=true;
    }
}
Prop.prototype.draw =function (){
    this._move();
    ctx.beginPath();
    ctx.drawImage(rewardImg,this.type*this.w,0,this.w,this.h,this.x,this.y,this.w,this.h)
}







